<?php
/*
	插件概览
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$plugin_name = $_RQ['basicname'] ? $_RQ['basicname'] : '';
if($_RQ['op']=='get'){
	//显示统计数据
		$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
		$weektime = mktime(23,59,59,date('m'),date('d')-date('w')+7-7,date('Y'));
		$mounthtime =  mktime(0,0,0,date('m'),1,date('Y'));
		//普通会员
		$usersall=pdo_count('jy_xiuvote_user',array('uniacid'=>$_SESSION['uniacid']));
		//月普通会员
		$usersyue=pdo_count('jy_xiuvote_user',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>$mounthtime));
		//周普通会员
		$usersweek=pdo_count('jy_xiuvote_user',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>$weektime));
		//日普通会员
		$usersday=pdo_count('jy_xiuvote_user',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>$daytime));
		//VIP
		$vipall=pdo_count('jy_xiuvote_user',array('uniacid'=>$_SESSION['uniacid'],'isvip'=>1));
		//月VIP
		$vipyue=pdo_count('jy_xiuvote_user',array('uniacid'=>$_SESSION['uniacid'],'isvip'=>1,'createtime >'=>$mounthtime));
		//周VIP
		$vipweek=pdo_count('jy_xiuvote_user',array('uniacid'=>$_SESSION['uniacid'],'isvip'=>1,'createtime >'=>$weektime));
		//日VIP
		$vipday=pdo_count('jy_xiuvote_user',array('uniacid'=>$_SESSION['uniacid'],'isvip'=>1,'createtime >'=>$daytime));
		
		//费用
		$vipfeeall=pdo_getsum('jy_xiuvote_viporder',array('uniacid'=>$_SESSION['uniacid'],'ispay'=>1),'fee');
		//月VIP
		$vipfeeyue=pdo_getsum('jy_xiuvote_viporder',array('uniacid'=>$_SESSION['uniacid'],'ispay'=>1,'createtime >'=>$mounthtime),'fee');
		//周VIP
		$vipfeeweek=pdo_getsum('jy_xiuvote_viporder',array('uniacid'=>$_SESSION['uniacid'],'ispay'=>1,'createtime >'=>$weektime),'fee');
		//日VIP
		$vipfeeday=pdo_getsum('jy_xiuvote_viporder',array('uniacid'=>$_SESSION['uniacid'],'ispay'=>1,'createtime >'=>$daytime),'fee');
		
		$return['htmls']=array(
				array('type'=>'data','one_num'=>3,'title'=>'日,周,月VIP/总会员数据指标(/个)','datas'=>array(
					array('title'=>'今日','num'=>2,'data'=>array($vipday,$usersday)),
					array('title'=>'本周','num'=>2,'data'=>array($vipweek,$usersweek)),
					array('title'=>'本月','num'=>2,'data'=>array($vipyue,$usersyue)),
					array('title'=>'总共','num'=>2,'data'=>array($vipall,$usersall)),
				)),
				array('type'=>'data','one_num'=>3,'title'=>'日,周,月VIP费用数据指标(/元)','datas'=>array(
					array('title'=>'今日','num'=>1,'data'=>'￥'.price($vipfeeday)),
					array('title'=>'本周','num'=>1,'data'=>'￥'.price($vipfeeweek)),
					array('title'=>'本月','num'=>1,'data'=>'￥'.price($vipfeeyue)),
					array('title'=>'总共','num'=>1,'data'=>'￥'.price($vipfeeall)),
				)),
		);
	set_html('framess',$this->menu($plugin_name));
	exi($return);
}